const interObserver = new IntersectionObserver((ens, obs) => {
  if (!ens?.length) return;
  ens?.forEach((entry) => {
    if (entry.isIntersecting) {
      const imageDom = entry.target;
      imageDom.src = imageDom.getAttribute('data-src') || '';
      obs.unobserve(entry.target);
    }
  });
});
const initLazyImage = (el) => interObserver.observe(el);
export const lazyImage = {
  mounted: initLazyImage,
};
